﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Sex.aspx.cs" Inherits="Catering.Catering_Page.system.Sex" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <style type="text/css">
        *{margin:0px; padding:0px;}
        body{ font-size:14px;}
        .data_css{width:98%;margin-top:10px;height:250px; overflow-y:auto; overflow-x:hidden;border:#ccc 1px solid;}
        .data_css table{width:100%;}
        .data_css th{ background:url(../../Images/th_02bg.gif) repeat-x 0px 0px;padding:0px; text-align:center;height:29px; border-right:#ccc 1px solid;}
        .data_css th a{ font-weight:400; text-decoration:none; color:#000;}
        .data_css td{ height:20px; text-align:center;}
    </style>

    <script type="text/javascript">
        $(document).ready(function () {
            $("a:contains('编辑')").text("").append("<img src=\"../../Images/file.gif\" border=\"0\" />");
            $("a:contains('删除')").text("").append("<img src=\"../../Images/trash.gif\" border=\"0\" />");
            $("a:contains('新建')").text("").append("<img src=\"../../Images/jiahao.gif\" width=\"16\" height=\"16\" border=\"0\" />");
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="data_css">
    
        <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
            AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSource1" 
            EmptyDataText="没有可显示的数据记录。" onrowcommand="GridView1_RowCommand">
            <Columns>
               
                <asp:BoundField DataField="id" HeaderText="序号" ReadOnly="True" 
                    SortExpression="id" />
                <asp:BoundField DataField="SexName" HeaderText="性别" 
                    SortExpression="SexName" />
                <asp:CommandField ShowInsertButton="true" ShowDeleteButton="True" ShowEditButton="True" HeaderText="操作" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:CMS_CateringConnectionString %>" 
            DeleteCommand="DELETE FROM [Sex] WHERE [id] = @id" 
            InsertCommand="INSERT INTO [Sex] ([id], [SexName], [temp1], [temp2]) VALUES (@id, @SexName, @temp1, @temp2)" 
            ProviderName="<%$ ConnectionStrings:CMS_CateringConnectionString.ProviderName %>" 
            SelectCommand="SELECT [id], [SexName], [temp1], [temp2] FROM [Sex]" 
            UpdateCommand="UPDATE [Sex] SET [SexName] = @SexName, [temp1] = @temp1, [temp2] = @temp2 WHERE [id] = @id">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="id" Type="Int32" />
                <asp:Parameter Name="SexName" Type="String" />
                <asp:Parameter Name="temp1" Type="String" />
                <asp:Parameter Name="temp2" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="SexName" Type="String" />
                <asp:Parameter Name="temp1" Type="String" />
                <asp:Parameter Name="temp2" Type="String" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    
    </div>
        <asp:Panel runat="server" ID="Panel_Add" Visible="false">
   <table border="1">
   <tr>
   <td>性别</td>
  
   <td><asp:TextBox ID="txt_Sex_Name" runat="server"></asp:TextBox>   </td>
     </tr>
  <tr>
    <td>备注</td>
   <td><asp:TextBox ID="txt_Sex_Back" TextMode="MultiLine" runat="server"></asp:TextBox></td>
     </tr><tr>
    <td colspan="2"><asp:Button ID="but_SexInfo_Add" runat="server" 
            onclick="but_SexInfo_Add_Click" Text="添加性别"/>
            <asp:Button ID="but_SexInfo_Clear" runat="server" 
            onclick="but_SexInfo_Add_Clear" Text="取消添加"/>
            </td>
   </tr>
   </table>
   </asp:Panel>
    </form>
</body>
</html>
